<!-- 左侧侧边栏 -->
<aside class="main-sidebar">

    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">

        <!-- 侧边栏菜单 -->
        <ul class="sidebar-menu">
            <!-- Optionally, you can add icons to the links -->
            <li class="active"><a href="{% url 'index' %}"><i class="fa fa-link"></i> <span>首页</span></a></li>
            <li class="treeview">
                <a href="#"><i class="fa fa-link"></i> <span>路由管理</span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right">

              </i>
            </span>
                </a>
                <ul class="treeview-menu">
                    {#                    <li><a href="{% url 'system:route' %}">路由列表</a></li>#}
                </ul>
            </li>

            {#                        <li class="treeview">#}
            {#                            <a href="#"><i class="fa fa-gg"></i> <span>基础设置</span>#}
            {#                                <span class="pull-right-container">#}
            {#                          <i class="fa fa-angle-left pull-right">#}
            {##}
            {#                          </i>#}
            {#                        </span>#}
            {#                            </a>#}
            {#                            <ul class="treeview-menu">#}
            {#                                <li><a href="{% url 'rbac:basic-structure' %}">组织架构</a></li>#}
            {#                                <li><a href="{% url 'rbac:basic-user' %}">用户管理</a></li>#}
            {#                            </ul>#}
            {#                        </li>#}
            {##}
            {#                        <li class="treeview">#}
            {#                            <a href="#"><i class="fa fa-user-plus"></i> <span>权限管理</span>#}
            {#                                <span class="pull-right-container">#}
            {#                          <i class="fa fa-angle-left pull-right">#}
            {##}
            {#                          </i>#}
            {#                        </span>#}
            {#                            </a>#}
            {#                            <ul class="treeview-menu">#}
            {#                                <li><a href="{% url 'rbac:rbac-menu' %}">菜单管理</a></li>#}
            {#                                <li><a href="{% url 'rbac:rbac-role' %}">角色管理</a></li>#}
            {#                            </ul>#}
            {#                        </li>#}

            {% for menu in request.reveal_menu %}
                {% if not menu.url %}
                    <!--如果菜单没有url则这个二级菜单是一个菜单组，样式设置为treeview-->
                    <li class="treeview" id="{{ menu.code }}">
                        <a href="">
                            <i class="{{ menu.icon }}"></i><span>{{ menu.name }}</span>
                            <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i>
                            </span>
                        </a>
                        <ul class="treeview-menu">
                            {% for sub in  menu.sub_menu %}
                                <!--获取二级菜单的子菜单，作为折叠组中的三级菜单 -->
                                <li id="{{ sub.code }}">
                                    <a href="{{ sub.url }}"><i class="fa fa-caret-right"></i>{{ sub.name }}</a>
                                </li>
                            {% endfor %}
                        </ul>
                    </li>
                {% else %}
                    <!-- 如果二级菜单有URL，则这是一个功能菜单，直接作为导航菜单，不再添加折叠样式 -->
                    <li id="{{ menu.code }}">
                        <a href="{{ menu.url }}"><i class="{{ menu.icon }}"></i><span>{{ menu.name }}</span>
                        </a>
                    </li>
                {% endif %}
            {% endfor %}
        </ul>
        <!-- /.sidebar-menu -->
    </section>
    <!-- /.sidebar -->
</aside>